package com.ruoyi.activiti.domain;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@ApiModel("任务处理人对象")
@Data
public class TaskAssignee {
    @ApiModelProperty("是否已签收")
    boolean claimed;

    @ApiModelProperty("分配类型，USER：指定处理人，GROUP：分配到岗位")
    String assigneeType;

    @ApiModelProperty("指定处理人username")
    String username;

    @ApiModelProperty("指定处理人昵称")
    String userNickname;

    @ApiModelProperty("处理岗位id")
    String groupId;

    @ApiModelProperty("处理岗位名称")
    String groupName;

    public static TaskAssignee newUserAssignee(String id, String name, boolean claimed){
        TaskAssignee taskAssignee = new TaskAssignee();
        taskAssignee.setAssigneeType("USER");
        taskAssignee.setUsername(id);
        taskAssignee.setUserNickname(name);
        taskAssignee.setClaimed(claimed);
        return taskAssignee;
    }

    public static TaskAssignee newGroupAssignee(String id, String name, boolean claimed){
        TaskAssignee taskAssignee = new TaskAssignee();
        taskAssignee.setAssigneeType("GROUP");
        taskAssignee.setGroupId(id);
        taskAssignee.setGroupName(name);
        taskAssignee.setClaimed(claimed);
        return taskAssignee;
    }
}
